/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ocumed.presentation.utils;

import java.text.Collator;

/**
 *
 * @author apr3455
 */
public class ListSort {
    
    public void sortArray(Object[] strArray, SortableModel model)
    {
        if (strArray.length == 1)    // no need to sort one item
        return;
        Collator collator = Collator.getInstance();
        Object strTemp;
        for (int i=0;i<strArray.length;i++)
        {
            for (int j=i+1;j<strArray.length;j++)
            {
                if (collator.compare(strArray[i], strArray[j]) > 0)
                {
                    strTemp = strArray[i];
                    strArray[i] = strArray[j];
                    strArray[j] = strTemp;
                    model.changeIdPos(i, j);
                }
            }
        }
    }
}
